﻿#region License
/*Copyright (c) 2010 Andrew Collard (andrewcollard@hotmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
#endregion

using System.IO;

namespace TorchView.Game
{
  /// <summary>
  /// Values from the Journal screen.
  /// </summary>
  public sealed class Journal
  {
    public uint Unknown1 { get; set; }
    public uint GoldGathered { get; set; }
    public uint LevelsExplored { get; set; }
    public uint StepsTaken { get; set; }
    public uint QuestsCompleted { get; set; }
    public uint Deaths { get; set; }
    public uint MonstersDefeated { get; set; }
    public uint ChampionsDefeated { get; set; }
    public uint SkillsOrSpellsCast { get; set; }
    public uint ChestsOpened { get; set; }
    public uint TrapsSprung { get; set; }
    public uint BarrelsBroken { get; set; }
    public uint PotionsUsed { get; set; }
    public uint PortalsUsed { get; set; }
    public uint FishCaught { get; set; }
    public uint TimesGambled { get; set; }
    public uint TimesTransmuted { get; set; }
    public uint TimesEnchanted { get; set; }


    public static Journal Read(BinaryReader reader)
    {
      Journal journal = new Journal();
      journal.Unknown1 = reader.ReadUInt32();
      journal.GoldGathered = reader.ReadUInt32();
      journal.LevelsExplored = reader.ReadUInt32();
      journal.StepsTaken = reader.ReadUInt32();
      journal.QuestsCompleted = reader.ReadUInt32();
      journal.Deaths = reader.ReadUInt32();
      journal.MonstersDefeated = reader.ReadUInt32();
      journal.ChampionsDefeated = reader.ReadUInt32();
      journal.SkillsOrSpellsCast = reader.ReadUInt32();
      journal.ChestsOpened = reader.ReadUInt32();
      journal.TrapsSprung = reader.ReadUInt32();
      journal.BarrelsBroken = reader.ReadUInt32();
      journal.PotionsUsed = reader.ReadUInt32();
      journal.PortalsUsed = reader.ReadUInt32();
      journal.FishCaught = reader.ReadUInt32();
      journal.TimesGambled = reader.ReadUInt32();
      journal.TimesTransmuted = reader.ReadUInt32();
      journal.TimesEnchanted = reader.ReadUInt32();

      return journal;
    }
  }
}
